package com.gitee.nacosorder.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassName OrderController
 * @Description TODO
 * @Author xiongchao
 * @Date 2021/1/5 10:06
 **/
@RestController
public class OrderController {

    @Autowired
    private RestTemplate restTemplate;

    private final String URL = "http://nacos-provider-service";

    @GetMapping("/order/{id}")
    public String testOrder(@PathVariable("id") Integer id){
        return restTemplate.getForObject(URL + "/payment/nacos/" + id,String.class);
    }

}
